package bot;

import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.List;

import datacollection.WebParser;

public class CityCollectionBot{
	public static void main(String[] args){
		WebParser web = new WebParser();
		List<String> test = web.getCitiesInState("http://en.wikipedia.org/wiki/Maryland");
		String data = "";
		for (int i = 0; i < test.size(); i++){
			data += test.get(i);
		}
		File f = new File("c:\\Users\\Jamison\\Documents\\PopulationInfo\\MarylandLinks.txt");
		try{
			FileOutputStream writer = new FileOutputStream(f);
			writer.write(data.getBytes());
		} 
		catch (FileNotFoundException e){
			e.printStackTrace();
		} 
		catch (IOException e){
			e.printStackTrace();
		}
	}
}
